package com.yh.correct.dao;

import java.util.List;

import com.yh.correct.model.SysRolePermission;

/**
 * 角色权限dao层接口
 * @author Administrator
 *
 */
public interface ISysRolePermissionMapper {
	/**
	 * 获取角色权限关系
	 * @param record
	 * @return
	 * @throws Exception
	 */
	SysRolePermission getSysRolePermission(SysRolePermission record) throws Exception;
	/**
	 * 增加角色权限关系
	 * @param record
	 * @return
	 * @throws Exception
	 */
	int insertSysRolePermission(List<SysRolePermission> list) throws Exception;
	/**
	 * 删除角色权限关系(主键)
	 * @param record
	 * @return
	 * @throws Exception
	 */
	int deleteSysRolePermission(SysRolePermission record) throws Exception;
	/**
	 * 通过roleId删除角色权限关系
	 * @param roleId
	 * @return
	 * @throws Exception
	 */
	int deleteByRoleId(int roleId) throws Exception;
	/**
	 * 通过permissionId删除角色权限关系
	 * @param permissionId
	 * @return
	 * @throws Exception
	 */
	int deleteByPermissionId(int permissionId) throws Exception;
	/**
	 * 更新角色权限关系
	 * @param record
	 * @return
	 * @throws Exception
	 */
	int updateSysRolePermission(SysRolePermission record) throws Exception;
	/**
	 * 通过roleid获取权限列表
	 * 关联查询SysPermission表
	 * @param roleid
	 * @return
	 * @throws Exception
	 */
	List<SysRolePermission> findPermissionListByRoleId(int roleid) throws Exception;
}
